/////////////////////////////////////////////
// ObjectARX defined commands

#include "StdAfx.h"
#include "StdArx.h"


// This is command 'CEL'
void cel()
{
	ads_name srcSS;		// Source selection set
	ads_name targEnt;	// Target entity
	int rc;				// Result code
	ads_point pickPt;	// Used in the call to acedEntSel()

	acedPrompt("\nSelect entities for layer change ");
	rc = acedSSGet(NULL, NULL, NULL, NULL, srcSS);
	if(rc != RTNORM)
	{
		acutPrintf("\nNo entities selected!! ");
		return;
	}

	rc = acedEntSel("\nSelect target layer entity. ", targEnt, pickPt);
	switch(rc)
	{
		case RTERROR :
			acutPrintf("\nNothing selected!! ");
		break;

		case RTCAN :
			acutPrintf("\nUser canceled. ");
		break;

		case RTNORM :
			chgEntsLyr(targEnt, srcSS);
		break;
	}

	// Don't forget to free the selection set
	acedSSFree(srcSS);
}

